package cn.xd.base.domain.repository;

import cn.xd.base.basic.type.DictCode;
import cn.xd.base.basic.type.KeyValueId;
import cn.xd.base.basic.type.KeyValueKey;
import cn.xd.base.basic.type.KeyValueValue;
import cn.xd.base.domain.entity.KeyValue;
import cn.xd.core.ddd.db.Repository;
import cn.xd.core.response.CollectResult;
import cn.xd.core.response.ObjectResult;

public interface KeyValueRepository extends Repository<KeyValue, KeyValueId> {


    ObjectResult<KeyValue> findOneForLimitOne(DictCode type);

    ObjectResult<KeyValue> find(DictCode type, KeyValueId parentId, KeyValueValue value);

    ObjectResult<KeyValue> find(DictCode type, KeyValueKey key);

    CollectResult<KeyValue> getKeyValuesByParentId(Boolean filterWithoutShow, DictCode type, KeyValueId id);

    CollectResult<KeyValue> getKeyValueByType(DictCode type);
}
